package com.hdu.controller.contentManagement;

import com.hdu.pojo.Result;
import com.hdu.service.ICoursePublishService;
import com.hdu.vo.CoursePreviewVo;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/opens")
@Api(value = "课程公开查询接口", tags = "课程公开查询接口")
public class CourseOpenController {

    private final ICoursePublishService coursePublishService;

    @GetMapping("/course/whole/{courseId}")
    public Result<CoursePreviewVo> getPreviewInfo(@PathVariable Long courseId) {
        // 获取课程预览信息
        return Result.success(coursePublishService.getCoursePreviewInfo(courseId));
    }
}
